import request from '@/utils/request'

// 查询产品功能列表
export function listFunc(query) {
  return request({
    url: '/biz/func/list',
    method: 'get',
    params: query
  })
}

// 查询产品功能详细
export function getFunc(id) {
  return request({
    url: '/biz/func/' + id,
    method: 'get'
  })
}

// 新增产品功能
export function addFunc(data) {
  return request({
    url: '/biz/func',
    method: 'post',
    data: data
  })
}

// 修改产品功能
export function updateFunc(data) {
  return request({
    url: '/biz/func',
    method: 'put',
    data: data
  })
}

// 删除产品功能
export function delFunc(id) {
  return request({
    url: '/biz/func/' + id,
    method: 'delete'
  })
}

// 导出产品功能
export function exportFunc(query) {
  return request({
    url: '/biz/func/export',
    method: 'get',
    params: query
  })
}

//  查询产品类型属性
export function selectTypeFuncList(typeId) {
  return request({
    url: '/biz/func/selectTypeFuncList/'+typeId,
    method: 'get'
  })
}

//  查询产品类型属性
export function selectProductTypeList(id) {
  return request({
    url: '/biz/func/selectProductTypeList/'+id,
    method: 'get'
  })
}

// 产品类型选择树
export function selectFuncAll() {
  return request({
    url: '/biz/func/selectFuncAll',
    method: 'get'
  })
}

// 根据产品类型获取告警名称
export function selectTypeFuncNames(query) {
  return request({
    url: '/biz/func/selectTypeFuncNames',
    method: 'get',
    params: query
  })
}
